<table border="1" cellpadding="3" cellspacing="0" width="80%">
    <tr align="center">
        <td colspan="5" height="25">Laporan Stok Barang</td>
    </tr>
    <tr align="center">
        <td>Kode Stock</td>
        <td>Tanggal Stock</td>
        <td>Nama Suplier</td>
        <td>Nama Barang</td>
        <td>Stock Akhir</td>
    </tr>
	<?php 
		foreach($dt_stock as $items) 
		{
	?>    
            <tr class="cellDefault">
                <td><?php echo $items->KodeStok ?></td>
                <td><?php echo $items->CreatedOn ?></td>
                <td><?php echo $items->Suppliername ?></td>
                <td><?php echo $items->Productname ?></td>
                <td><?php echo $items->StockAkhir ?></td> 
            </tr>    
  	<?php } ?>
</table>
<?php
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=exceldata.xls");
header("Pragma: no-cache");
header("Expires: 0");	
?>  